powerpc/boot: Request no dynamic linker for boot wrapper
authorNicholas Piggin <npiggin@gmail.com>
Mon, 28 Nov 2016 01:42:26 +0000 (12:42 +1100)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 4 Jan 2017 19:39:36 +0000 (19:39 +0000)
commita6d96c22592162d2262fa7aa68994f167101210d
treef5956574902ae6be43b46f438343368b6ffb5e45
parent1e84ec1ca0833057fa65f78dc19ad53d33ffc9ef
powerpc/boot: Request no dynamic linker for boot wrapper

The boot wrapper performs its own relocations and does not require
PT_INTERP segment. However currently we don't tell the linker that.

Prior to binutils 2.28 that works OK. But since binutils commit
1a9ccd70f9a7 ("Fix the linker so that it will not silently generate ELF
binaries with invalid program headers. Fix readelf to report such
invalid binaries.") binutils tries to create a program header segment
due to PT_INTERP, and the link fails because there is no space for it:

  ld: arch/powerpc/boot/zImage.pseries: Not enough room for program headers, try linking with -N
  ld: final link failed: Bad value

So tell the linker not to do that, by passing --no-dynamic-linker.

Cc: stable@vger.kernel.org
Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Drop dependency on ld-version.sh and massage change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
[bwh: Backported to 4.8: adjust context]

Gbp-Pq: Topic bugfix/powerpc
Gbp-Pq: Name powerpc-boot-request-no-dynamic-linker-for-boot-wrap.patch
arch/powerpc/boot/wrapper